﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ElevatorSimulator
{
    public partial class FloorUI : Form
    {
        int numOfFloors;
        int numOfElevators;

        AdminUI admin;
        QueueOut queueoutpan;
        QueueIn queueinpan;

        public FloorUI()
        {
            admin = new AdminUI();

            numOfFloors = Building.Instance.getNumFloors();
            numOfElevators = Building.Instance.getNumElevators();

            buildQueues();
            InitializeComponent();
            
        }
        private void buildQueues()
        {
            int outWidth = 120;
            int outHeight = 0;
            int inWidth = 0;
            int inHeight = 0;

            if (numOfElevators == 1)
            {
                outWidth += 120;
            }
            else if (numOfElevators == 2)
            {
                outWidth += 240;
            }
            else
            {
                outWidth += 360;
            }

            for (int i = 0; i < numOfFloors; i++)
            {
                System.Console.WriteLine("Printing build queue line");

                //Add out panel to form
                queueinpan = new QueueIn();
                queueinpan.Location = new Point(inWidth, inHeight);
                //fm2.TopLevel = false;
                //queueinpan.Dock = DockStyle.Left;
                this.Controls.Add(queueinpan);
                queueinpan.Show();

                //Add in panel to form
                queueoutpan = new QueueOut();
                queueoutpan.Location = new Point(outWidth, outHeight);
                //queueoutpan.Dock = DockStyle.Left;
                this.Controls.Add(queueoutpan);
                queueoutpan.Show();

                //make positioning rather than docking
            }
        }

        private void FloorUI_Load(object sender, EventArgs e)
        {

        }
    }
}
